import { UUID2 } from "../utils/utils";

export default class Component {
  id = null;
  name = null;
  type = null;

  alias = null;
  icon = null;
  img = null;

  locked = false;
  hidden = false;

  selected = false;
  hovered = false;
  renaming = false;
  // 元件属性
  attr = {
    x: 0,
    y: 0,
    w: 100,
    h: 100,
    deg: 0,
    opacity: 1,
    filpV: false,
    filpH: false
  };
  // 项目id
  projectId = 0;
  // 父级id
  parentId = null;
  // 配置项
  config = null;

  // dataSource
  dataSource = null;

  // 事件
  events = null;

  // 动作
  actions = null;

  // 绑定值
  propValue = null;

  animate = { enterAnimation: "", leaveAnimation: "" };

  constructor(name, attr, type = "com") {
    this.id = UUID2(24);
    this.name = `${name}`;
    this.type = type;
    this.attr = { ...this.attr, ...attr };
  }

  initData() {

  };

  loadData() {

  };
}
